<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>

  <script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/vue/2.6.14/vue.js"
    type="application/javascript"></script>
</head>

<body>
  <div id="app">
    <el-tree :data="list">
      <div slot-scope="{index,item}">
        <div>{{index}} - {{item.name}}</div>
      </div>
    </el-tree>
  </div>
</body>
<script>
  Vue.component('el-tree', {
    props: ['data'],
    template: `
      <div>
        <ul>
          <li v-for="(item,index) in data">
            <slot :item="item" :index="index"></slot>  
          </li>
        </ul>
      </div>
    `
  })
  new Vue({
    el: '#app',
    data () {
      return {
        list: [{ name: 'zs' }, { name: 'ls' }]
      }
    },
    created () { },
    mounted () {
    },
    methods: {
    },
  })
</script>

</html>